<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-07-24
    	描述：结业证书管理
    -->
	<div class="Announcements">
		<div class="search-box">
			<div class="fl">
				<select name="classId" class="search-boxs" v-model="classId">
					<option value="">全部</option>
          <option v-for="cla in classList" :value="cla.id" >{{cla.name}}</option>
				</select>
				<input class="user-boxs user-name" type="button" value="数据导出" @click="exportData"/>
			</div>
			<div class="fr">
        <input name="search" class="search-boxs" type="text" autocomplete="off" v-model="search" />
        <input class="user-box user-name" type="button" value="检索" @click="searchTodo" />
			</div>
		</div>
		<div class="PressRelease-list">
			<table>
				<thead>
					<tr>
						<th class="table-text-th1">姓名</th>
						<th class="table-text-th2">身份证号</th>
						<th class="table-text-th1">班级名称</th>
						<!--<th class="table-text-th1">证书编号</th>-->
						<th class="table-text-th1">证书附件</th>
						<!--<th class="table-text-th2">操作</th>-->
					</tr>
				</thead>
				<tbody>
          <tr v-if="graduationList.length == 0">
            <td colspan="4" class="center">暂无数据！</td>
          </tr>
          <tr v-for="graduation in graduationList">
						<td>{{graduation.studentName}}</td>
						<td>{{graduation.studentIdentityCard}}</td>
						<td>{{graduation.className}}</td>
						<!--<td>{{graduation.num}}</td>-->
						<td>
              <template v-if="graduation.graduationCertificateUrl != null && graduation.graduationCertificateUrl != ''">
                <input type="button" value="修改" class="delete write" @click="openModal(graduation, 1)"/>
                <input type="button" value="查看" class="delete write" @click="preview(graduation.graduationCertificateUrl)"/>
              </template>
              <template v-else>
                <input type="button" value="上传" class="delete write" @click="openModal(graduation, 0)"/>
              </template>
            </td>
						<!--<td>
              <input @click="openModal(graduation.id)" type="button" value="修改" class="delete" />
							<input type="button" value="删除" class="delete" @click="deleteData(graduation.id)" />
            </td>-->
					</tr>
				</tbody>
			</table>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
			<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		</div>
		<!--模态框-->
		<div v-if="modelShow" class="tenant-model">
			<div class="tenant-model-content">
				<header class="tenant-model-header">
					<h3>{{optionStatus == 0 ? "上传" : "修改"}}</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<form class="form-box" id="graduationForm">
              <input type="hidden" name="id" :value="graduation.id"/>
							<div class="form-line imgbox clearfix">
								<label>附件上传：</label>
								<input type="file" ref="handIdFront" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg($event)" style="display: none;" />
								<a class="Public-btn1 uploadbtn handIdFrontA" @click="$refs.handIdFront.click()">上传附件</a>
								<ul class="img-box">
									<li v-for="item in FileUpload">{{item}}</li>
								</ul>
                <input type="hidden" name="graduationCertificateUrl" v-model="graduation.graduationCertificateUrl"/>
							</div>
						</form>
					</div>
				</div>
				<footer class="tenant-model-footer">
					<button class="determine" @click="updateData">确定</button>
				</footer>
			</div>
		</div>
	</div>

</template>
<script src="./ManagementCompletionCertificates.js"></script>

<style scoped>
	@import "ManagementCompletionCertificates.css"
</style>
